/**
 * Created by Administrator on 2018/2/26 0026.
 */

payType = function (value, row, index) {
    if (row.payType == 1) {
        return '<span>' + '支付宝' + '</span>'
    } else {
        return '<span>' + '微信' + '</span>'
    }
};

auditFormatter = function (value, row, index) {
    if (row.status == 2) {
        return [
            '<a class="agree" href="javascript:void(0)" >同意审核</a>' +
            '&nbsp;&nbsp;'
            // '<a class="refuse" href="javascript:void(0)" >拒绝审核</a>'
        ].join('');
    } else if (row.status == 3) {
        return '<span>' + '通过审核' + '</span>'
    }
};

auditEvent = {
    'click .agree': function (e, value, row) {
        comment.showOperationTips("确定同意审核吗？", function () {
            $.post($().AbsUrlParse('/web/deposit/updateStatus'), {
                id: row.id
            }, function (data) {
                if (data.state == true) {
                    if (data.res.code == 40000) {
                        hint("同意成功");
                        var table = $("#table");
                        table.bootstrapTable("refresh");
                    } else {
                        hint(data.res.msg);
                    }
                } else {
                    hint(data.msg);
                }
            });
        });
    }
};

selectType = function (value, row, index) {
    if (row.type == 1) {
        return '<span>' + '假一赔三' + '</span>'
    } else {
        return '<span>' + '消费者保障金' + '</span>'
    }
};

returnMoney = function (value, row, index) {
    if (row.returnMoneyTime == null||row.returnMoneyTime == "") {
        return '<span>' + '未处理' + '</span>'
    } else {
        return '<span>' + row.returnMoneyTime + '</span>'
    }
};

var queryDeposit = function () {
    var busName = $("#busName").val();
    var url = $().AbsUrlParse("/web/deposit/queryDeposit?businessName=" + busName);
    var table = $("#table");
    table.bootstrapTable("refresh", {url: url});
};